#include "commn.h"

int main()
{

  int fd = open(MY_PATH, O_WRONLY);
  if(fd < 0) {
    perror("open");
    return 1;
  }


  while(1) {
    printf("请输入# ");
    fflush(stdout);
    char buffer[SIZE] = {0};
    ssize_t s = read(0, buffer, sizeof(buffer)-1);
    printf("%s", buffer);
    if(s > 0) {
      buffer[s] = 0;
      write(fd, buffer, strlen(buffer));
    }

  }

  return 0;
}
